import request from "@/utils/request";

//角色列表
export const getRoles = (page, size) => request({ url: `/sys/role`, method: 'get', params: { page, pagesize: size } })

//删除角色
export function delRoleById(id) {
    return request({ url: `/sys/role/${id}`, method: 'delete' })
}

//获取角色
export function gelRolesById(id) {
    return request({ url: `/sys/role/${id}`, method: 'get' })
}

//添加角色
export function addRole(data) {
    return request({ url: `/sys/role`, method: 'post', data })
}

//更新角色
export function updateRole(data) {
    return request({ url: `/sys/role/${data.id}`, method: 'put', data })
}

//更新权限
export function updatePermission(data) {
    return request({ url: `/sys/role/assignPrem`, method: 'put', data })
}

